home *** CD-ROM | disk | FTP | other *** search
- package
- {
- import flash.display.MovieClip;
- import flash.events.Event;
-
- public class ItemChar extends MovieClip
- {
-
-
- private var §\x01\x01\x02\t§:*;
-
- private var §\x01\x01\x0b\n§:String;
-
- internal const UPPERBORDER:* = 150;
-
- private var §\x01\x01\x0b\x0b§:int = 50;
-
- private var §\x01\x01\x06\r§:*;
-
- private var §\x01\x01\x0b\f§:* = null;
-
- private var §\x01\x01\x0b\r§:Number = 30;
-
- internal const DIM:* = 30;
-
- internal const VSPEED:* = 30;
-
- internal const LOWERBORDER:* = 250;
-
- private var §\x01\x01\x0b\x0f§:Number = 5;
-
- internal const HSPEED:* = 5;
-
- public function ItemChar()
- {
- §\x01\x01\x0b\f§ = null;
- §\x01\x01\x0b\x0b§ = 50;
- §\x01\x01\x0b\x0f§ = HSPEED;
- §\x01\x01\x0b\r§ = VSPEED;
- super();
- }
-
- public function GetCharType() : String
- {
- return "item";
- }
-
- public function Init(param1:*, param2:*, param3:*, param4:*) : *
- {
- §\x01\x01\x02\t§ = param1;
- §\x01\x01\x06\r§ = param2;
- §\x01\x01\x0b\f§ = param3;
- §\x01\x01\x0b\n§ = param4;
- this.x = -(Math.random() * 500);
- this.y = UPPERBORDER + 10;
- this.width = DIM;
- this.height = DIM;
- if(param4 == "full")
- {
- §\x01\x01\x0b\x0f§ = HSPEED * 3;
- }
- else
- {
- §\x01\x01\x0b\x0f§ = HSPEED;
- }
- §\x01\x01\x0b\x0e§(§\x01\x01\x0b\n§);
- §\x01\x01\x02\t§.addEventListener(Event.ENTER_FRAME,§\x01\x01\x06\x0e§,false,0,true);
- }
-
- public function GetHealthDamage() : int
- {
- if(§\x01\x01\x0b\n§ == "health" || §\x01\x01\x0b\n§ == "full")
- {
- return §\x01\x01\x0b\x0b§;
- }
- return 0;
- }
-
- public function GetArmorDamage() : int
- {
- if(§\x01\x01\x0b\n§ == "armor" || §\x01\x01\x0b\n§ == "full")
- {
- return §\x01\x01\x0b\x0b§;
- }
- return 0;
- }
-
- private function §\x01\x01\x0b\x0e§(param1:String) : *
- {
- gotoAndPlay(param1);
- if(param1 == "speed")
- {
- §\x01\x01\x0b\x0b§ = 0;
- }
- }
-
- private function §\x01\x01\x06\x0e§(param1:Event) : *
- {
- this.x += §\x01\x01\x0b\x0f§;
- this.y = Math.sin(this.x / 51) * (LOWERBORDER - UPPERBORDER) + UPPERBORDER;
- if(this.x > 640)
- {
- Destroy();
- }
- }
-
- public function Destroy() : *
- {
- §\x01\x01\x02\t§.removeEventListener(Event.ENTER_FRAME,§\x01\x01\x06\x0e§);
- §\x01\x01\x0b\f§.RemoveItem();
- }
- }
- }
-